package com.sg.web;


import com.sg.service.JoinService;
import com.sg.vo.JobChartInfo;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @author lyx
 * 图标统计控制器
 */
@Controller

public class JobChartsController {

    Logger logger = Logger.getLogger(JobChartsController.class);

    @Autowired
    JoinService joinService;

    @RequestMapping("/admin/tojobcharts")
    public String tojobCharts(){
        logger.info("进入了图表控制器");
        return "/admin/jobchartstat";
    }

    @RequestMapping("/admin/jobchartfirst")
    @ResponseBody
    public List<JobChartInfo> jobchartFirst(){
        System.out.println("jobchartfirst---");
        List<JobChartInfo> list = joinService.findStatPie();
        return list;
    }

    @RequestMapping("/admin/jobchartsecode")
    @ResponseBody
    public Map<String, List> jobchartSecode(){
        System.out.println("jobchartSecode---");
        Map<String,List> map = joinService.findStatBar();
        return map;
    }

}
